package com.ymttest.database.sqlwapper.sqrefund;

import java.util.HashMap;
import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.sqrefund.RefundBillIndex;

public class RefundBillIndexWrapper {
	
	SqlManager manager;

	public RefundBillIndexWrapper() {
		manager = new SqlManager("sqrefund");
	}
	
	@SuppressWarnings("unchecked")
	public RefundBillIndex selectByRefundNoAndMerchantId(String refundNo, Long merchantId) {

		HashMap<String, Object> map = new HashMap<>();
		
		map.put("merchant_id", merchantId);
		map.put("refund_no", refundNo);
		
		RefundBillIndex refundBillIndex = null;
		
		List<RefundBillIndex> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqrefund.RefundBillIndexMapper.selectByRefundNoAndMerchantId",
						map);
		manager.commit();
		
		if (result.size() > 0)
			refundBillIndex = result.get(0);
		
		return refundBillIndex;
	}
	
	public static void main(String[] args) {
		
		RefundBillIndexWrapper test = new RefundBillIndexWrapper();
		
//		SellerLevelHistory sellerLevelHistory = new SellerLevelHistory();
//		
//		sellerLevelHistory.setDDate(YMTDateUtil.getDate());
//		sellerLevelHistory.setSellerID(24635724);
//		sellerLevelHistory.setUpdateTime(YMTDateUtil.getDate());
//		sellerLevelHistory.setUnconfirm_amount(BigDecimal.TEN);
//		
		System.out.println(test.selectByRefundNoAndMerchantId("TH201212000135770", 500002490L));
	}
}
